"use strict";
exports.__esModule = true;
exports.diffObject = exports.diff = void 0;
var diff = function (old, newVal) {
    if ((!old && newVal) || (old && !newVal))
        return true;
    for (var k in newVal) {
        if (old[k] !== newVal[k])
            return true;
    }
    for (var k in old) {
        if (old[k] !== newVal[k])
            return true;
    }
    return false;
};
exports.diff = diff;
var diffObject = function (old, newVal) {
    if (!old && newVal)
        return newVal;
    if (!newVal && old)
        return old;
    var diffObj = {};
    var isDiff = false;
    for (var k in newVal) {
        if (old[k] !== newVal[k]) {
            isDiff = true;
            diffObj[k] = newVal[k];
        }
    }
    for (var k in old) {
        if (old[k] !== newVal[k]) {
            isDiff = true;
            diffObj[k] = newVal[k];
        }
    }
    return isDiff ? diffObj : null;
};
exports.diffObject = diffObject;
